package com.example.ploy4j.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        // 添加favicon映射
        registry.addResourceHandler("/favicon.ico")
                .addResourceLocations("classpath:/static/img/favicon.ico")
                .setCachePeriod(3600); // 缓存一小时

        // 添加.well-known目录的映射
        registry.addResourceHandler("/.well-known/**")
                .addResourceLocations("classpath:/static/.well-known/")
                .setCachePeriod(3600);
    }
} 